#!/bin/bash

#解包
tar xf httpd-2.4.46.tar.gz
cd httpd-2.4.46/

# 安装依赖包
yum -y install gcc gcc-c++ apr* pcre*

# 配置http
./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi

#安装编译
make && make install

#优化
ln -s /usr/local/httpd/bin/* /usr/local/bin/
cd
chmod +x ~/httpd
cp -rf ~/httpd /etc/init.d/
cp -rf ~/httpd /usr/local/httpd/bin/apachectl
chkconfig --add httpd
systemctl start httpd
systemctl enable httpd
